home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ WinXP AutoPlay 3.xpl < prev    next >
Text File  |  2003-08-01  |  3KB  |  106 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="8"
  3. "COUNT"="2"
  4. "UIPATH"="System\AutoPlay\Data CDs Options"
  5. "NAME"="AutoPlay Block list"
  6. "OSVERSION"="0000011"
  7. "VERSION"="1.01"
  8. "LANGUAGE"="VBScript"
  9. "TEXT 1"="Add New"
  10. "TEXT 2"="Delete"
  11. "DESCRIPTION 1"="When a Data CD is inserted and AutoPlay is activated, Windows will check for the file AUTORUN.INF on the root of the drive. If this file is found, it's read and see if it contains a configuration line like OPEN="xxx.exe". If so, this command will be executed. Many software packages use this to display a menu so the user can choose what to do. 
  12. "DESCRIPTION 2"="However, some badly coded software packages start directly the installation without any menu, and this is something you properly don't want. Therefore, Windows does include a block list of commands that will NOT be executed if the OPEN= configuration line matches one of the items in this list. 
  13. "DESCRIPTION 3"="For example, the list normally contains the entry "*setup*.exe". So, if the file AUTORUN.INF of a drive contains the line "OPEN=SETUP.EXE", Windows won't execute the command since the command is on the block list.
  14. "DESCRIPTION 4"="You can use these settings here to remove items from this block list or add new ones. 
  15. "DESCRIPTION 5"="Click "Add" to add an item or "Delete" to remove an item."
  16. "AUTHOR"="Xteq Systems"
  17. "CONTACTURL"="http://www.xteq.com"
  18. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  19. "COMMENT 1"=" "
  20.  
  21.  
  22.   sP="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\CancelAutoplay\Files\"
  23.  
  24. Dim aryLoc()
  25. Dim iReadAllCount
  26.  
  27.  
  28. Sub Plugin_Initialize 
  29.   iReadAllCount=0
  30.   Call ReloadAll
  31. End Sub
  32.  
  33. Sub ReloadAll
  34.  for i=1 to iReadAllCount
  35.      Call SetUIElement(i,"")
  36.  next 
  37.  
  38.  i=0
  39.  
  40.  iC=RegEnumValues(sP)
  41.  i=i+iC
  42.  
  43.  ReDim aryLoc(i)
  44.  iReadAllCount=1
  45.  
  46.  Call ReadAll(sP,1)
  47. End Sub
  48.  
  49. Sub ReadAll(key,idx)
  50.  iC=RegEnumValues(key)
  51.  if iC>0 then
  52.     for l=1 to iC
  53.         sName=RegEnumElement(l)
  54.         
  55.         if InStr(sName,"\")=0 then
  56.            Call SetUIElement(iReadAllCount,sName)
  57.            aryLoc(iReadAllCount)=idx
  58.            iReadAllCount=iReadAllCount+1
  59.         end if
  60.     Next
  61.  end if
  62.  
  63. End Sub
  64.  
  65.  
  66.  
  67. Sub Plugin_CheckData(ElementIndex)
  68. End Sub
  69.  
  70. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  71.  
  72.  if ElementIndex=1 then '//Add new
  73.     sNewName=InputWindow("Please enter the file pattern to be blocked, e.g. ┤*setup*.exe┤","",1) 
  74.     if IsEmpty(sNewName)=false then
  75.        Call RegWriteValue(sP & sNewName,"",1)
  76.        Call ReloadAll()
  77.  
  78.        Call MsgInformation("New item added")
  79.     end if
  80.  else
  81.     If ElementIndex=2 then 'Delete
  82.        if ElementSubIndex>0 then
  83.           sRegPath=sP
  84.           'Look up Registry name
  85.           sRegName=GetUIElement(ElementSubIndex)
  86.  
  87.           Call RegDeleteValue(sRegPath & sRegName)
  88.           Call ReloadAll
  89.  
  90.           Call MsgInformation("Item has been removed")
  91.        else
  92.           Call MsgError("Please select an item to be deleted first")
  93.        end if
  94.     end if
  95.  
  96.  end if
  97.  
  98.  
  99. End Sub
  100.  
  101. Sub Plugin_Terminate 
  102. End Sub
  103.  
  104.  
  105.  
  106.